<?php
session_start();
ob_start();
include_once dirname(dirname(__FILE__)) . '/include/common.php';
$page = isset($_POST["page"]) ? intval($_POST["page"]) : 2;
$category_id = isset($_POST["category_id"]) ? intval($_POST["category_id"]) : 0;
$page = $page + 1;
$core = new core();
$load_more = 0;
$total =0;
$list_product = $core->getCompareProductList($page, $load_more,$total);
$html = '';

if ($list_product) {
    foreach ($list_product as $product) {

        $html.='  <tr>
                                                    <td>
                                                        '.$product->product_name.'

                                                    </td>

                                                    <td>
                                                        <p>'.$product->product_code.'</p>
                                                    </td>

                                                    <td class="center">
                                                        <img class="photo_product" style="width: 100px;" src="photo/'.$product->old_photo.'" rel="photo/'.$product->old_photo.'"/>
                                                    </td>

                                                    <td class="center">
                                                        <img class="photo_product" style="width: 100px;" src="tmp_photo_crawl/'.$product->new_photo.'" rel="tmp_photo_crawl/'.$product->new_photo.'"/>
                                                    </td>


                                                </tr>';
    }
}
echo json_encode(array('type' => 0, 'html' => $html, 'page' => $page, 'load_more' => $load_more,'total'=>$total));
die;
?>